<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>验证车主</title>
		 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
         <meta name="apple-mobile-web-app-capable" content="yes">
         <meta content="yes" name="apple-touch-fullscreen">
         <meta name="apple-mobile-web-app-status-bar-style" content="black">  
         <script src="js/add_js.js"></script>
	</head>
	<body>
		<!--nav-->
        <nav class="bar bar-tab">
             <a class="tab-item external active" href="home.html">我的</a>
             <a class="tab-item external" href="order.html">定单</a>
             <a class="tab-item external" href="carRental.html">出租</a>
             <a class="tab-item external" href="rentalCar.html">租车</a>
             <div class="clear"></div>
        </nav>
        <!--nav-->
		<div class="page content">
      	    <header class="bar bar-nav">
               <a  class="button button-link button-nav pull-right active">身份认证</a>
               <a href="home.html" class="button button-link button-nav pull-right">返回我的账户 </a>
            </header>
      		<div class="login-list checkOwner-list">
      			<ul>
      				<li><input class="c-border login-list-qr" type="text" placeholder="姓名" name="u_name"></li>
      			    <li><input class="c-border login-list-qr" type="text" placeholder="身份证号" name="idcard"> </li>
      			    <li><input class="c-border login-list-qr" type="text" placeholder="驾驶证号" name="dri_license"> </li>
      			    <!--<li><input class="c-border login-list-qr" type="text" placeholder="身份证有效期" name="idc_expiratime"> </li>
      			    <li><input class="c-border login-list-qr" type="text" placeholder="准驾车型" name="q_drivingtype"> </li>
      			    <li><input class="c-border login-list-qr" type="text" placeholder="驾驶证档案编号" name="fil_number" ></li>
      			    <li><input class="c-border login-list-qr" type="text" placeholder="初次领证日期" name="fir_licensetime"> </li>
      			    <li><input class="c-border login-list-qr" type="text" placeholder="驾驶证有效期" name="lic_expiratime"> </li>
      			    <li><input class="c-border login-list-qr" type="text" placeholder="有效期限" name="usef_time"> </li>-->
      			    <li>
      			    	 <div class="c-border login-list-yz register-list-yz check-car-upload-img img-sfz-z" name='0'>
      			    	  <img name='0' src="img/icon/upload.png">上传身份证正面
      			         </div>
      			    </li>
      			     <li>
      			    	 <div class="c-border login-list-yz register-list-yz check-car-upload-img img-sfz-f" name='0'>
      			    	  <img name='0' src="img/icon/upload.png">上传身份证反面
      			         </div>
      			    </li>
      			     <li>
      			    	 <div class="c-border login-list-yz register-list-yz check-car-upload-img img-jsz-z" name='0'>
      			    	  <img name='0' src="img/icon/upload.png">上传驾驶证正面
      			         </div>
      			    </li>
      			    <li>
      			    	<div class="c-border login-list-yz register-list-yz check-car-upload-img img-jsz-f" name='0'>
      			    		<img name="0" src="img/icon/upload.png">上传驾驶证仿面
      			    	</div>
      			    </li>
      			    <li class="register-list-sq" style="margin-bottom: 8px;padding-right: 10px;">拍摄时尽量避免反光和阴影过重</li>
      			    <li class="register-list-sq" style="padding-right: 10px;">您的个人信息仅用于身份验证</li>
      			    <li class="login-list-b"><a class="bottn" id="zc" style="float: right;">提交</a><div class="clear"></div></li> 
      			 </ul>
      	    </div>
      	<script>
      	
      		$(document).ready(function(){
      			//验证登陆
      			if(my.checkLogin()){
      				my.scollToggleBar()
      			//my.checkLogin()
      			//key=my.get_key(sessionStorage.token)
      	    	 key=my.get_key(my.getCookie('token'))
      			//表单选中效果切换
//    			$('.login-list input').focus(function(){
//    				$(this).css('color','#fff')
//    			})
//    			$('.login-list input').blur(function(){
//    				$(this).css('color','#5926BF')
//    			})
      			
      			$('.login-list-b a').click(function(){ 
      				$(this).css({'color':'#fff','backgroundColor':'#5926BF'})
      			})
      			//上传照片
      			$('.img-sfz-z').click(function(){
      				var list={"id":".img-sfz-z","text":"身份证正面"}
      			        list=JSON.stringify(list)
      				 ad.native_get_photo(list)
      			})
      			$('.img-sfz-f').click(function(){
      				 var list={"id":".img-sfz-f","text":"身份证反面"}
      			        list=JSON.stringify(list)
      				 ad.native_get_photo(list)
      			})
      			$('.img-jsz-z').click(function(){
      				 var list={"id":".img-jsz-z","text":"驾驶证正面"}
      			        list=JSON.stringify(list)
      				 ad.native_get_photo(list)
      			})
      			$('.img-jsz-f').click(function(){
      				 var list={"id":".img-jsz-f","text":"驾驶证反面"}
      			        list=JSON.stringify(list)
      				 ad.native_get_photo(list)
      			})
      			$('#zc').click(function(){
      				for(i=0;i<$('.checkOwner-list :text').length;i++){
      					if($('.checkOwner-list :text').eq(i).val()==''){
      						$.toast('请填写完整')
      						$(':text').eq(i).focus()
      						return false
      					}
      				}
      				if($('.img-sfz-z').attr('name')=='0'){$.toast('请上传身份证正面'); return false}
      				if($('.img-sfz-f').attr('name')=='0'){$.toast('请上传身份证反面'); return false}
      				if($('.img-jsz-z').attr('name')=='0'){$.toast('请上传驾驶证正面'); return false}
      				if($('.img-jsz-f').attr('name')=='0'){$.toast('请上传驾驶证反面'); return false}
      				$.showIndicator()
      				var info={
      					//'u_userid':sessionStorage.id,
      					'u_userid':my.getCookie('id'),
      					'u_name':$('[name=u_name]').val(),
      					'u_idcard':$('[name=idcard]').val(),
      					'dri_license':$('[name=dri_license]').val(),
      					'idc_first_img':$('.img-sfz-z').attr('name'),
      					'idc_secend_img':$('.img-sfz-f').attr('name'),
      					'lic_first_img':$('.img-jsz-z').attr('name'),
      					'lic_secend_img':$('.img-jsz-f').attr('name'),
      					}
    					info=JSON.stringify(info)
                        info=my.cryptoASEencrypt(info,key).toString()
      				$.ajax({
      						type:"post",
      						url:"http://192.168.1.10:8082/index.php?r=userabout%2Fuser%2Fuseridentity",
      						data:{
      							'api_value':info
      						},
      						async:true,			
      						error:function(){
      							$.hideIndicator()
      							$.toast("提交失败，请重试..");
      						},
      						success:function(data){
      							if(data.match("err_code")!=null){
      								$.hideIndicator()
      								switch(JSON.parse(data).err_code)
      								{
      									case 40003:
      									    my.tokenExpire()
      									   break;
      									case 50051:
      									   $.alert(JSON.parse(data).err_msg);
      									   $.router.loadPage("home.html");
      									   break;
      									default:
      									   $.alert(JSON.parse(data).err_msg);
      								}
                                         
      							}else{
      								    $.hideIndicator()
      								    //data=JSON.parse(my.cryptoASEdencrypt(data,key))
        								$.toast("提交成功，等待审核");
      							        $.router.loadPage("home.html");
      							}
      						},
      				});
      						
      			})
      			}
      		})
      
      	</script>
      </div>
	</body>
</html>
